package org.fude.bootstrap.controller;


import org.fude.dao.UserMapper;
import org.fude.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class TestController {
	
	@Autowired
	UserMapper userMapper;
	
	@RequestMapping("/add")
	String test() {
		User user = new User();
		user.setName("xixi");
		user.setUname("xixi");
		user.setPwd("xixi");
		user.setSex(1);
		user.setTel(123456);
		user.setStatus(1);
		userMapper.addUser(user);
		
		return "I am zhuxi";
	}
	
	@PostMapping("user/telResult")
	boolean ts(String tel) throws Exception{
		tel = userMapper.findByTel(tel);
		if(tel != null ) {
			return true;
		}
		return false;
	}
}
